1 -- phpMyAdmin SQL Dump
2 -- version 4.7.0
3 -- https://www.phpmyadmin.net/
4 --
5 -- Host: 127.0.0.1
6 -- Generation Time: Nov 01, 2017 at 09:21 AM
7 -- Server version: 10.1.26-MariaDB
8 -- PHP Version: 7.1.8
9
10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 SET AUTOCOMMIT = 0;
12 START TRANSACTION;
13 SET time_zone = "+00:00";
14
15
16 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
17 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
18 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
19 /*!40101 SET NAMES utf8mb4 */;
20
21 --
22 -- Database: `kp_db`
23 --
24
25 -- --------------------------------------------------------
26
27 --
28 -- Table structure for table `billings`
29 --
30
31 CREATE TABLE `billings` (
32 `id` int(10) NOT NULL,
33 `customer_id` int(10) NOT NULL,
34 `bill_id` varchar(255) NOT NULL,
35 `bill_month` varchar(255) NOT NULL,
36 `Discount` int(11) NOT NULL DEFAULT '0',
37 `bill_amount` int(11) NOT NULL,
38 `paid_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
39 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
40
41 -- --------------------------------------------------------
42
43 --
44 -- Table structure for table `cash_collection`
45 --
46
47 CREATE TABLE `cash_collection` (
48 `id` int(10) NOT NULL,
49 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
50 `amount` bigint(20) NOT NULL,
51 `payee` varchar(255) NOT NULL,
52 `remarks` text NOT NULL
53 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
54
55 -- --------------------------------------------------------
56
57 --
58 -- Table structure for table `cash_expanse`
59 --
60
61 CREATE TABLE `cash_expanse` (
62 `id` int(11) NOT NULL,
63 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
64 `amount` bigint(20) NOT NULL,
65 `purpose` text NOT NULL,
66 `remarks` text NOT NULL
67 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
68
69 -- --------------------------------------------------------
70
71 --
72 -- Table structure for table `customers`
73 --
74
75 CREATE TABLE `customers` (
76 `id` int(11) NOT NULL,
77 `full_name` varchar(50) NOT NULL,
78 `nid` varchar(16) NOT NULL,
79 `address` text,
80 `conn_location` text NOT NULL,
81 `email` varchar(30) NOT NULL,
82 `ip_address` varchar(16) NOT NULL,
83 `conn_type` varchar(10) NOT NULL,
84 `package_id` int(10) NOT NULL,
85 `contact` varchar(20) NOT NULL,
86 `dropped` tinyint(1) NOT NULL DEFAULT '0'
87 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
88
89 -- --------------------------------------------------------
90
91 --
92 -- Table structure for table `kp_category`
93 --
94
95 CREATE TABLE `kp_category` (
96 `cat_id` int(3) NOT NULL,
97 `cat_name` varchar(20) COLLATE utf8_unicode_ci NOT NULL
98 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Category name for products table, parents to products';
99
100 --
101 -- Dumping data for table `kp_category`
102 --
103
104 INSERT INTO `kp_category` (`cat_id`, `cat_name`) VALUES
105 (2, 'MC'),
106 (1, 'Onu');
107
108 -- --------------------------------------------------------
109
110 --
111 -- Table structure for table `kp_products`
112 --
113
114 CREATE TABLE `kp_products` (
115 `pro_id` int(3) NOT NULL COMMENT 'Product identity no',
116 `pro_name` varchar(40) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Product name',
117 `pro_unit` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Product unit',
118 `pro_category` varchar(20) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL COMMENT 'Product category: Child of kp_category table',
119 `pro_details` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Product details',
120 `pro_dropped` int(1) NOT NULL DEFAULT '0' COMMENT 'If a product is dropped or not'
121 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table for individuals products';
122
123 -- --------------------------------------------------------
124
125 --
126 -- Table structure for table `kp_user`
127 --
128
129 CREATE TABLE `kp_user` (
130 `user_id` int(11) NOT NULL,
131 `user_name` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
132 `user_pwd` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
133 `full_name` text COLLATE utf8_unicode_ci NOT NULL,
134 `email` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
135 `contact` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
136 `address` text COLLATE utf8_unicode_ci,
137 `c_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
138 `authentication` int(1) NOT NULL DEFAULT '0'
139 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
140
141 --
142 -- Dumping data for table `kp_user`
143 --
144
145 INSERT INTO `kp_user` (`user_id`, `user_name`, `user_pwd`, `full_name`, `email`, `contact`, `address`, `c_date`, `authentication`) VALUES
146 (32, 'moshiur', '$2y$10$Xk8TYun1Crr0gIS960sSCeh7rfXfQfK2VJ3rJ7SThN/6cehlop35O', 'Moshiur Rahman', 'unimrgm@gmail.com', '01719454658', 'Bogra', '2017-10-21 20:39:51', 0),
147 (33, 'misu', '$2y$10$xuIQ8LSURAJbGj8dD8Wr9.0PzbPq2qUvaLjmSwMh/5xEY.SHeKYnS', 'Mushfiqur Rahman', 'misu@gmail.com', '01719454658', 'Bogra', '2017-10-22 07:29:55', 0),
148 (34, 'admin', '$2y$10$51/xhfZqmMt6pr9HhXfZB.Punql5srC5vXtOEradf0Cs5Dg/FzHYy', 'Mr Admin', 'admin@netwaybd.com', '051-56565', 'Netway', '2017-10-23 15:28:31', 0);
149
150 -- --------------------------------------------------------
151
152 --
153 -- Table structure for table `packages`
154 --
155
156 CREATE TABLE `packages` (
157 `id` int(10) NOT NULL,
158 `name` varchar(255) NOT NULL,
159 `fee` bigint(20) NOT NULL,
160 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
161 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
162
163 --
164 -- Dumping data for table `packages`
165 --
166
167 INSERT INTO `packages` (`id`, `name`, `fee`, `created_at`) VALUES
168 (1, '2 Mbps', 800, '2017-10-30 19:22:42'),
169 (2, '5 Mbps', 2000, '2017-11-01 07:21:18'),
170 (3, '3 Mbps ', 1200, '2017-11-01 07:21:53');
171
172 -- --------------------------------------------------------
173
174 --
175 -- Table structure for table `payments`
176 --
177
178 CREATE TABLE `payments` (
179 `id` int(10) NOT NULL,
180 `customer_id` int(10) NOT NULL,
181 `r_month` varchar(255) NOT NULL,
182 `amount` int(10) NOT NULL,
183 `g_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
184 `p_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
185 `paid` tinyint(1) NOT NULL DEFAULT '0'
186 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
187
188 -- --------------------------------------------------------
189
190 --
191 -- Table structure for table `product`
192 --
193
194 CREATE TABLE `product` (
195 `id` int(11) NOT NULL,
196 `product_id` int(11) NOT NULL,
197 `quantity` int(11) NOT NULL,
198 `cdate` datetime DEFAULT CURRENT_TIMESTAMP,
199 `provider` varchar(50) NOT NULL,
200 `remarks` text NOT NULL,
201 `recipient` varchar(50) NOT NULL,
202 `type` tinyint(1) NOT NULL
203 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
204
205 --
206 -- Indexes for dumped tables
207 --
208
209 --
210 -- Indexes for table `billings`
211 --
212 ALTER TABLE `billings`
213 ADD PRIMARY KEY (`id`);
214
215 --
216 -- Indexes for table `cash_collection`
217 --
218 ALTER TABLE `cash_collection`
219 ADD PRIMARY KEY (`id`);
220
221 --
222 -- Indexes for table `cash_expanse`
223 --
224 ALTER TABLE `cash_expanse`
225 ADD PRIMARY KEY (`id`);
226
227 --
228 -- Indexes for table `customers`
229 --
230 ALTER TABLE `customers`
231 ADD PRIMARY KEY (`id`),
232 ADD UNIQUE KEY `nid` (`nid`);
233
234 --
235 -- Indexes for table `kp_category`
236 --
237 ALTER TABLE `kp_category`
238 ADD PRIMARY KEY (`cat_id`),
239 ADD KEY `cat_name` (`cat_name`);
240
241 --
242 -- Indexes for table `kp_products`
243 --
244 ALTER TABLE `kp_products`
245 ADD PRIMARY KEY (`pro_id`),
246 ADD UNIQUE KEY `pro_name` (`pro_name`),
247 ADD KEY `pro_category` (`pro_category`);
248
249 --
250 -- Indexes for table `kp_user`
251 --
252 ALTER TABLE `kp_user`
253 ADD PRIMARY KEY (`user_id`),
254 ADD UNIQUE KEY `user_name` (`user_name`);
255
256 --
257 -- Indexes for table `packages`
258 --
259 ALTER TABLE `packages`
260 ADD PRIMARY KEY (`id`);
261
262 --
263 -- Indexes for table `payments`
264 --
265 ALTER TABLE `payments`
266 ADD PRIMARY KEY (`id`);
267
268 --
269 -- Indexes for table `product`
270 --
271 ALTER TABLE `product`
272 ADD PRIMARY KEY (`id`);
273
274 --
275 -- AUTO_INCREMENT for dumped tables
276 --
277
278 --
279 -- AUTO_INCREMENT for table `billings`
280 --
281 ALTER TABLE `billings`
282 MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
283 --
284 -- AUTO_INCREMENT for table `cash_collection`
285 --
286 ALTER TABLE `cash_collection`
287 MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
288 --
289 -- AUTO_INCREMENT for table `cash_expanse`
290 --
291 ALTER TABLE `cash_expanse`
292 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
293 --
294 -- AUTO_INCREMENT for table `customers`
295 --
296 ALTER TABLE `customers`
297 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
298 --
299 -- AUTO_INCREMENT for table `kp_category`
300 --
301 ALTER TABLE `kp_category`
302 MODIFY `cat_id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
303 --
304 -- AUTO_INCREMENT for table `kp_products`
305 --
306 ALTER TABLE `kp_products`
307 MODIFY `pro_id` int(3) NOT NULL AUTO_INCREMENT COMMENT 'Product identity no';
308 --
309 -- AUTO_INCREMENT for table `kp_user`
310 --
311 ALTER TABLE `kp_user`
312 MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;
313 --
314 -- AUTO_INCREMENT for table `packages`
315 --
316 ALTER TABLE `packages`
317 MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
318 --
319 -- AUTO_INCREMENT for table `payments`
320 --
321 ALTER TABLE `payments`
322 MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
323 --
324 -- AUTO_INCREMENT for table `product`
325 --
326 ALTER TABLE `product`
327 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;COMMIT;
328
329 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
330 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
331 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;